package com.example.sys.controller;

import com.example.base.dto.R;
import com.example.sys.dto.req.MenuContactBackendReq;
import com.example.sys.service.ISystemBackendInterfaceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 后端接口信息表 前端控制器
 * </p>
 *
 * @author ywh
 * @since 2024-12-25
 */
@Api(tags = "后端接口信息表")
@RestController
@RequestMapping("/systemBackendInterface")
public class SystemBackendInterfaceController {

    private ISystemBackendInterfaceService service;

    @Autowired
    public SystemBackendInterfaceController(ISystemBackendInterfaceService service){
        this.service = service;
    }

    @ApiOperation("菜单关联后端接口")
    @RequestMapping(value = "/menuContactBackend", method = RequestMethod.POST)
    public R<Boolean> menuContactBackend(@RequestBody @Validated @NotNull(message = "请求对象为空") MenuContactBackendReq req){
        return R.success(service.menuContactBackend(req));
    }
}
